import axios from '@/utils/axios.js'
var pre = 'platform/admin/v1/corp/'
var func = ['getInfoDic', 'getAddDic', 'getStatus', 'getData', 'create', 'update', 'getCertDic', 'certUpload', 'certData', 'getList', 'audit']
var api = {}
func.forEach(value => {
  api[value] = pre + value
})

var getAddDic = (params) => {
  return axios.get(api.getAddDic, {params: params})
}

var getStatus = (params) => {
  return axios.get(api.getStatus, {params: params})
}

var create = (params) => {
  return axios.post(api.create, params)
}

var getInfoDic = (params) => {
  return axios.get(api.getInfoDic, {params: params})
}

var getData = (params) => {
  return axios.get(api.getData, {params: params})
}

var update = (params) => {
  return axios.put(api.update, params)
}

var getCertDic = (params) => {
  return axios.get(api.getCertDic, {params: params})
}

var certUpload = (params) => {
  return axios.put(api.certUpload, params)
}

var certData = (params) => {
  return axios.post(api.certData, params)
}

var getList = (params) => {
  return axios.get(api.getList, {params: params})
}

var audit = (params) => {
  return axios.post(api.audit, params)
}

export { getAddDic, getStatus, getInfoDic, getData, create, update, getCertDic, certUpload, certData, getList, audit }
